package com.zxy.ziems.server.classify.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zxy.btp.common.response.PageResult;
import com.zxy.ziems.server.classify.pojo.dto.ClassifyDevicePropertyDTO;
import com.zxy.ziems.server.classify.pojo.dto.ClassifyDto;
import com.zxy.ziems.server.classify.pojo.entity.Classify;
import com.zxy.ziems.server.classify.pojo.param.ClassifyDevicePropertyPageParam;
import com.zxy.ziems.server.classify.pojo.vo.ClassifyDevicePropertyVO;
import com.zxy.ziems.server.classify.pojo.vo.ClassifyTreeNode;
import com.zxy.ziems.server.classify.pojo.vo.ClassifyVO;

import java.util.List;

public interface ClassifyService extends IService<Classify> {

    void addOrUpdate(ClassifyDto classifyDto);

    void delete(String classifyId);

    List<ClassifyTreeNode> getTree(Integer dataObtainType, Integer type);

    //根据上级分类id递归查询所有的分类id
    List<String> getClassifyId(String parentClassifyId);

    List<Classify> getChildrenClassify(String classifyId);

    List<String> getByIdList(List<String> queryIdList);

    List<String> getChildrenId(String classifyId);

    /**
     * 获取设备列表通过分类ID
     *
     * @param classifyId
     * @return
     */
    List<ClassifyTreeNode> deviceListByClassId(String classifyId);

    List<Classify> classifyListByClassifyId(String classifyId);


    /**
     * 根据id查询详情
     *
     * @param id
     * @return
     */
    ClassifyVO detailById(String id);

    Classify detailByDescription(String description);

    List<Classify> classifysByDescription(String description);

    /**
     * 分页查询
     *
     * @param param
     * @return
     */
    PageResult<ClassifyDevicePropertyVO> pageListBy(ClassifyDevicePropertyPageParam param);

    void saveClassifyDevice(ClassifyDevicePropertyDTO dto);

    List<ClassifyVO> getByParentClassifyId(String parentClassifyId);

    List<ClassifyVO> getByParentByDict(String dictCode, String itemName);

    List<ClassifyVO> getByParentClassifyIds(List<String> parentClassifyIds);

    List<ClassifyTreeNode> treeByParentClassifyId(Integer dataObtainType, Integer type, String parentClassifyId);
}
